package com.example.demo.demencryptor;

import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.salt.ZeroSaltGenerator;

public class EncryptorUtils {
    private static final String PASSWORD_INFO = "redisPWD@redisPWD";
    public static void main(String[] args) {
        StandardPBEStringEncryptor standardPBEStringEncryptor = new StandardPBEStringEncryptor();
        standardPBEStringEncryptor.setPassword(PASSWORD_INFO);
        standardPBEStringEncryptor.setSaltGenerator(new ZeroSaltGenerator());
        //解密后的文本
        String redisPwd = standardPBEStringEncryptor.encrypt("redis");
        System.out.println("redis=" + redisPwd);
        System.out.println("redis=" + standardPBEStringEncryptor.decrypt(redisPwd));
    }
}
